<template>
    <div style="width: 256px">
      <a-button type="primary" style="margin-bottom: 16px" @click="toggleCollapsed">
        <a-icon :type="collapsed ? 'menu-unfold' : 'menu-fold'" />
      </a-button>
      <a-menu
        :default-selected-keys="['1']"
        :default-open-keys="['sub1']"
        mode="inline"
        theme="dark"
        :inline-collapsed="collapsed"
      >
        <a-menu-item key="1">
          <a-icon type="appstore" />
          <span>菜单1</span>
        </a-menu-item>
        <a-menu-item key="2">
          <a-icon type="car" />
          <span>菜单2</span>
        </a-menu-item>
        <a-menu-item key="3">
          <a-icon type="customer-service" />
          <span>菜单3</span>
        </a-menu-item>
        <a-sub-menu key="sub1">
          <span slot="title"><a-icon type="idcard" /><span>分组一</span></span>
          <a-menu-item key="5">
            菜单5
          </a-menu-item>
          <a-menu-item key="6">
            菜单6
          </a-menu-item>
          <a-menu-item key="7">
            菜单7
          </a-menu-item>
          <a-menu-item key="8">
            菜单8
          </a-menu-item>
        </a-sub-menu>
        <a-sub-menu key="sub2">
          <span slot="title"><a-icon type="appstore" /><span>分组二</span></span>
          <a-menu-item key="9">
            菜单9
          </a-menu-item>
          <a-menu-item key="10">
            菜单10
          </a-menu-item>
          <a-sub-menu key="sub3">
            <span slot="title"><a-icon type="setting" /><span>分组三</span></span>
            <a-menu-item key="11">
              菜单11
            </a-menu-item>
            <a-menu-item key="12">
              菜单12
            </a-menu-item>
          </a-sub-menu>
        </a-sub-menu>
      </a-menu>
    </div>
  </template>
  
  <script>
  export default {
    data() {
      return {
        collapsed: false,
      };
    },
    methods: {
      toggleCollapsed() {
        this.collapsed = !this.collapsed;
      },
    },
  };
  </script>
  